Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move celopenapi/model to staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/ #109959

Merged
merged 1 commit into from Oct 7, 2022

Conversation

mk46
Copy link
Member

@mk46 mk46 commented May 11, 2022

What type of PR is this?

Move celopenapi/model to staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/

Add one of the following kinds:
/kind cleanup

Optionally add one or more of the following kinds if applicable:

/area code-organization

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #108346

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 11, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @mk46. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label May 11, 2022
@k8s-ci-robot k8s-ci-robot added area/apiserver sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 11, 2022
@mk46
Copy link
Member Author

mk46 commented May 11, 2022

/cc @jpbetz
/kind cleanup
/area code-organization

@k8s-ci-robot k8s-ci-robot requested a review from jpbetz May 11, 2022 07:04
@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. area/code-organization Issues or PRs related to kubernetes code organization and removed do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels May 11, 2022
@jpbetz
Copy link
Contributor

jpbetz commented May 11, 2022

I'm supportive of this change. We've almost entirely rewritten this code at this point making it impossible for us to "rebase" the code from its third party origin.

@jiahuif Do you have any concerns with this code move? I don't expect it to impact the work you are doing but wanted to double check.

I don't see any particularly obvious problem with the license file changes since we're retaining the same license. But if anyone with expertise on that could weight in, that would be helpful.

@jiahuif
Copy link
Member

jiahuif commented May 11, 2022

/assign

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 11, 2022
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 12, 2022
@mk46
Copy link
Member Author

mk46 commented May 12, 2022

Getting warning from go-lint

staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/model/schemas.go:45:2: const `minTimeSizeJSON` is unused (unused)                 
        minTimeSizeJSON = 5                                                                                                                           
        ^                                                                                                                                             
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/model/types.go:472:22: func `(*RuleTypes).convertToCustomType` is unused (unused) 
func (rt *RuleTypes) convertToCustomType(dyn *DynValue, declType *DeclType) *DynValue { 

Should I remove both in order to make go-lint happy?

@jpbetz
Copy link
Contributor

jpbetz commented May 12, 2022

Getting warning from go-lint


staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/model/schemas.go:45:2: const `minTimeSizeJSON` is unused (unused)                 

        minTimeSizeJSON = 5                                                                                                                           

        ^                                                                                                                                             

staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/model/types.go:472:22: func `(*RuleTypes).convertToCustomType` is unused (unused) 

func (rt *RuleTypes) convertToCustomType(dyn *DynValue, declType *DeclType) *DynValue { 



Should I remove both in order to make go-lint happy?

Yes. Linter errors are expected as part of this code move since the linters are disabled for third_party directories. Removing unused unexported code is safe.

@mk46
Copy link
Member Author

mk46 commented May 12, 2022

@jpbetz Removed unused code. Please allow CI to run tests.

@leilajal
Copy link
Contributor

/triage accepted

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Sep 16, 2022
@mk46
Copy link
Member Author

mk46 commented Sep 16, 2022

@mk46 do you still need this? please rebase if so, else we can close it out

PTAL

@k8s-triage-robot
Copy link

This PR may require API review.

If so, when the changes are ready, complete the pre-review checklist and request an API review.

Status of requested reviews is tracked in the API Review project.

Copy link
Contributor

@jpbetz jpbetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 16, 2022
@jpbetz
Copy link
Contributor

jpbetz commented Sep 16, 2022

@TristonianJones are you okay with this change from an attribution perspective? We're changed it a lot, to the point that it wouldn't be practical to rebase. And moving it out of third_party enables linting, which is desirable.

@TristonianJones
Copy link

@jpbetz I'm happy that what I did could serve as an inspiration and give an idea that developed into its own full-fledged offering. Please feel free to change the attribution with my blessing. :)

@jpbetz
Copy link
Contributor

jpbetz commented Sep 17, 2022

Thanks @TristonianJones!

/assign @lavalamp

This is ready for approval

@dims
Copy link
Member

dims commented Sep 19, 2022

/assign @liggitt @thockin

@liggitt
Copy link
Member

liggitt commented Sep 20, 2022

@jpbetz I'm happy that what I did could serve as an inspiration and give an idea that developed into its own full-fledged offering. Please feel free to change the attribution with my blessing. :)

Thanks, looks like there was one additional author on a couple commits in that package in https://github.com/google/cel-policy-templates-go/commits/master/policy/model. It would be good to get their ack as well.

I'm not sure the best way to capture what is effectively re-contributing the same code to this project under the Kubernetes license. At the very least, I'd like to have something captured in the commit itself and not just a github comment.

@liggitt
Copy link
Member

liggitt commented Sep 20, 2022

(mechanical change lgtm)

@jpbetz
Copy link
Contributor

jpbetz commented Sep 20, 2022

@jinmmin would you be willing to add a comment here that it's okay to relicense the contributions you've made to https://github.com/google/cel-policy-templates-go/commits/master/policy/model to the Kubernetes project? We've forked a small section of code from cel-policy-templates. We will add some notes in the commit history to try to retain some attribution. Thanks!

@jinmmin
Copy link

jinmmin commented Sep 20, 2022

@jinmmin would you be willing to add a comment here that it's okay to relicense the contributions you've made to https://github.com/google/cel-policy-templates-go/commits/master/policy/model to the Kubernetes project? We've forked a small section of code from cel-policy-templates. We will add some notes in the commit history to try to retain some attribution. Thanks!

@jpbetz, these commits are part of cel-policy-templates, so if the owner @TristonianJones is fine with the change, I have no objection :).

@lavalamp
Copy link
Member

lavalamp commented Oct 6, 2022

Since authors are OK with attribution change (see above comments), this lgtm.

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jpbetz, lavalamp, mk46

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 6, 2022
@k8s-ci-robot k8s-ci-robot merged commit 39ffd45 into kubernetes:master Oct 7, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.26 milestone Oct 7, 2022
danielye11 pushed a commit to danielye11/kubernetes that referenced this pull request Oct 10, 2022
…kg/apiserver/schema/cel/ (kubernetes#109959)

Co-authored-by: Manish Kumar <manish.kumar1@india.nec.com>
jaehnri pushed a commit to jaehnri/kubernetes that referenced this pull request Jan 3, 2023
…kg/apiserver/schema/cel/ (kubernetes#109959)

Co-authored-by: Manish Kumar <manish.kumar1@india.nec.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/apiserver area/code-organization Issues or PRs related to kubernetes code organization cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move CEL openapi integration code out of third_party/forked/celopenapi/model/registry.go